package vn.vfriends.vbox.component;

import java.util.Objects;
import org.primefaces.model.DefaultTreeNode;
import org.primefaces.model.TreeNode;
import vn.vfriends.vbox.model.File;

/**
 *
 * @author tuancn
 */
public class LazyFileTreeNode extends DefaultTreeNode {
    
    private Integer accountId;
    
    private File file;
    
    public LazyFileTreeNode(Object data, TreeNode parent, Integer accountId) {
        super(data, parent);
        this.accountId = accountId;
        if(data instanceof File) {
            file = (File)data;
        }
    }

    public Integer getAccountId() {
        return accountId;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 23 * hash + Objects.hashCode(this.accountId);
        hash = 23 * hash + Objects.hashCode(this.file);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LazyFileTreeNode other = (LazyFileTreeNode) obj;
        if (!Objects.equals(this.accountId, other.accountId)) {
            return false;
        }
        if (!Objects.equals(this.file, other.file)) {
            return false;
        }
        return true;
    }

    
}
